// ignore_for_file: prefer_const_constructors, prefer_interpolation_to_compose_strings

import 'package:flutter/material.dart';
import 'package:get/get.dart';

class LanguageView extends StatelessWidget {
  const LanguageView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('语言'),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            SizedBox(height: 10,),
            Text("tltle -> " + 'title'.tr,style: TextStyle(fontSize: 24),),
            SizedBox(height: 10,),
            Divider(),
            Text("login -> " + 'login'.trParams({'name':'ducafecat','email': 'ducafecat@gmail.com'}),style: TextStyle(fontSize: 24),),
            SizedBox(height: 10,),
            Divider(),
            SizedBox(height: 10,),
            ListTile(
              title: Text("切换语言"),
              subtitle: Text('zh-HK'),
              onTap: () {
                var locale = Locale('zh', 'JT');
                Get.updateLocale(locale);
              },
            ),
            SizedBox(height: 10,),
            ListTile(
              title: Text("切换语言"),
              subtitle: Text('zh-Hans'),
              onTap: () {
                var locale = Locale('zh', 'FT');
                Get.updateLocale(locale);
              },
            ),
            SizedBox(height: 10,),
            ListTile(
              title: Text("切换语言"),
              subtitle: Text('en-US'),
              onTap: () {
                var locale = Locale('en', 'US');
                Get.updateLocale(locale);
              },
            ),
          ],
        ),
      ),
    );
  }
}